import { defineStore } from 'pinia'
import {getDetail} from "@/apis/product/index"


const useProductStore = defineStore('product',  {

state: () => {
    return {
       goods:{}
    }
  },
  persist:true,
  actions:{
    //获取商品详情
     async getGoods (id:any) {
        const res = await getDetail(id)
        // console.log(res);
        this.goods =( res as any).result 

  },
},
  getters:{
   
  }
})

export default  useProductStore